package com.ming.mingbase.base.util;

import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class EncryptionUtil {
	public static String toMD5(String str){
		String result=null;
		byte[] strs=str.getBytes();
		try {
			MessageDigest digest=MessageDigest.getInstance("MD5");
			digest.update(strs);
			result=new BigInteger(1, digest.digest()).toString(32);
		} catch (NoSuchAlgorithmException e) {
			e.printStackTrace();
		}
		return result;
	}
}
